import 'package:flutter/cupertino.dart';

typedef void ButtonClick();

// ignore: must_be_immutable
class ContentBtn1Dialog extends StatefulWidget {
  ButtonClick btnClick;

  String title;

  String content;
  String btnContent;

  ContentBtn1Dialog(this.title, this.content, this.btnClick, this.btnContent);

  @override
  _ContentBtn1Dialog createState() => _ContentBtn1Dialog();
}

class _ContentBtn1Dialog extends State<ContentBtn1Dialog> {
  @override
  Widget build(BuildContext context) {
    return CupertinoAlertDialog(
      title: Text(widget.title),
      content: Column(
        children: <Widget>[
          SizedBox(
            height: 10,
          ),
          Align(
            child: Text(widget.content),
            alignment: Alignment(0, 0),
          ),
        ],
      ),
      actions: <Widget>[
        CupertinoDialogAction(
          child: Text(widget.btnContent),
          onPressed: () {
            Navigator.pop(context);
            widget.btnClick();
          },
        ),
      ],
    );
  }
}
